<?php

namespace App\Http\Requests\Api\V2_0_0;

use Illuminate\Foundation\Http\FormRequest;

class DistributCreateGroupRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'group_name' => 'required',
            'group_mobile' => 'required|regex:/^1[3456789]{1}\d{9}$/',
            'profit_percent' => 'required',
        ];
    }

    public function messages()
    {
        return [
            'group_name.required' => '团队名称不能为空',
            'group_mobile.required' => '手机号码不能为空',
            'group_mobile.regex' => '手机号码格式不正确',
            'profit_percent.required' => '团队成员id不能为空',
        ];
    }
}
